#ifndef FADE_ON_H_
#define FADE_ON_H_

#include "Effect.h"

namespace JDL
{
  class FadeOn : public Effect
  {
  public:
    FadeOn(Drawable *obj, int speed, bool repeat = false);
    virtual ~FadeOn();
    virtual void	Do(Drawable *obj)
    {
      if (_transparency > 0)
	_transparency -= _speed;
      else if (_repeat == true)
	_transparency = 255;
      obj->SetAlpha(_transparency);
    }
  protected:
    Uint8	_transparency;
    int		_speed;
  };
}

#endif
